<?php

class MessageService {

	function get() {
		global $_SGLOBAL;
		$uId = $_SGLOBAL['supe_uid'];
		$result = array(
			'message' => array(
				'unread' => 0,
				'mostRecent' => 0
			)
		);

		//短消息
		include_once S_ROOT.'./uc_client/client.php';
		$pmarr = uc_pm_list($uId, 1, 1, 'newbox', 'newpm');
		if($pmarr['count']) {
			$result['message']['unread'] = $pmarr['count'];
			$result['message']['mostRecent'] = $pmarr['data'][0]['dateline'];
		}

		return $result;
	}

}